package com.hoperun.checkcloth.common

import android.graphics.Color
import android.widget.Button
import androidx.databinding.BindingAdapter
import com.hoperun.checkcloth.R


@BindingAdapter("selectedState")
fun buttonSelectedState(button: Button, selected: Boolean) {

    val (color, drawable) = if (selected) {
        Pair(Color.WHITE, R.drawable.btn_blue_light)
    } else {
        Pair(Color.BLACK, R.drawable.btn_gray)
    }
    button.apply {
        setTextColor(color)
        setBackgroundResource(drawable)
    }
}


class ViewsBindingAdapter {

}